John drives for 3 hours at a speed of 60 mph and then turns around because he realizes he forgot something very important at home.  He tries to get home in 4 hours but spends the first 2 hours in standstill traffic.  He spends the next half-hour driving at a speed of 30mph, before being able to drive the remaining time of the 4 hours going at 80 mph.  How far is he from home at the end of those 4 hours?
When he turned around he was 3*60=
<gadget id="calculator">3*60</gadget>
<output>180</output>
180 miles from home.
He was only able to drive 4-2=
<gadget id="calculator">4-2</gadget>
<output>2</output>
2 hours in the first four hours.
In half an hour he goes 30*.5=
<gadget id="calculator">30*.5</gadget>
<output>15</output>
15 miles.
He then drives another 2-.5=
<gadget id="calculator">2-.5</gadget>
<output>1.5</output>
1.5 hours.
In that time he goes 80*1.5=
<gadget id="calculator">80*1.5</gadget>
<output>120</output>
120 miles.
So he drove 120+15=
<gadget id="calculator">120+15</gadget>
<output>135</output>
135 miles.
So he is 180-135=
<gadget id="calculator">180-135</gadget>
<output>45</output>
45 miles away from home.

<result>45</result>