cleaned up js a bit