Mounted combat, movement, free actions, dismounting, then free attack. Am I doing it right?

I have lvl 6 Half Orc Paladin with the shield master feat riding a worg. The paladin is Spd 30 the Worg is speed 50. I move forward speed x and spear a human with the lance 1d12+str+smite. I move forward 5 feet(reach) then as a bonus action I use shield master to knock the human prone. After that I dismount, and use my extra attack to stab my long sword 1d8+str+smite into a the prone human. Can I do this?

If so how far away from the human can I start and complete the action?
2(dash)*30(Ork speed)=x-5(closing 5 feet)- 1/2*30(ork speed used for dismount) 60=x-5-1/2*30 60=x-20=40 X=40 feet? Or am I doing it all wrong?