improved hit testing