Added basic collision detection