minor tweaks. lots of comments
remove zero delay frames from the final result before returning