Finally got rid of NaNs