code reorganization, fixed single precision correctness test