Adding a better max subroutine
More notes