Modifications to zensimilia's code to include @max, @min