Lots of changes in php code