FOUNDATIONS OF GEOMETRY