completed simple spell corrector in scala