Update copyright. Change max rang const to int
Fix math to be more vala like