commented documentation and added replay option at end of program