Changed max min and made them #defines