yet another attempt to deal with nan's... didn't i do this once already?