added some code to the php files