Added global isColliding function