Added simple location checking logic and test