Added more functionality to the engine

Also added a function to print the data to file