Ignore IntelliJ files
Added a more idiomatic version of the scala code