used the php and script folders + minor fixes