Added collides function

Added collides function.