Updated bounce.py to allow for 2D cases