Created preliminary work and most of the PHP