add scala syntax and misc changes