first implementation of collisions and scrolling