changed DBL_MAX to FLT_MAX and double conversion specifiers to float conversion specifiers; however something is still unstable