moved swap and check functions to public/javascript/arrayLibrary.js