Added to geometry and simplified code