hitTest into its own function