corrected normalise - cast to float in wrong place (was normalising everything to zero).