moved to php and added header and footer