fixed some issues with input and added output/saving functionality, there  may be an issue with the way it saves order-wise. It does input and output all of the given events though.