moving toRad function