added script for js, cleaned up formatting