moved endianness swap in data read to earlier to avoid messing up cast to float