Running a DC motor with PWM

Some time I would like to control the direction. I thought about using the Mosphet but it would simple to buy the chip. It works great just can't get it to do what I want.