Cleanup code. Added option for # nodes and time. Time not tested.