moved scripts to layout page; fixed some whitespace