Added a return value to a method, added global variables, fixed array, sent arguments to functions, restructured order to whole javascript.