fixed bugs and made a bouncing rectangle example