only fixes formating, use diamon syntax of java7
re-write code in scala