Fixed a couple bugs mainly by making sure that all variables and arrays are reset before reading data from the next swipe.  Now it's working for multiple swipes.