Foundations of Algebraic Geometry