added main loop, finished sample dataset