Everything seems to work, needs testing with larger data set