Cleanup on maxes, and tested partially lazy version.