reorganize all the code and added PHP