added option to write reward and gamelength to log file