Reformatted from html to php