Add toDouble
Use foldLeft instead instead of foldRight