+fix nans -still unsure result