fixed layout
fixed error checking and reporting
moved scripts to a js sub folder