Modifying droppedArray logic in custom js