Added SINGLEPRECISION define flag so we can change between double and float