Converted everything to php