Added an alternative version without using the math module