- finished all the invariant implementations (removed ToDos)
- optimized max by using descending order