Cleaned up js code to ie 11 standards