Fixed code that checks if something is inside an area