Code to check geometry