Derek/no results and cleanup

Fixing no result errors and cleaning up java script