cleaned up the code, added arrays to separate JS file