Added distanceToShape function to Shape class