Implemented pan function, jslinted