moved everything to php