Added looping function. It doesn't affect sequence recording (it used to do in earlier version)
Commented out unnecessary NSLog.