added screen edge detection, made speed reverse rather than just stop altogether (bounce) also added in logic so that the screen size can be changed rather than just set