cleaned up js and fixed a few bigs