Should use numpy rather than math :)