Moved PHP code to the top