Refactored old code to use relative paths and fixed <? issues