cleaned up agent code for game of life example