Added basic collision detection.