Found the solution to the bouncing problem - used the handout solution
from stanford - One of these days...!