bugfix: return float of magnitude and corrected function call