Had to import math to get this to work, if that's wrong just ignore.