new test and some refactoring for diamond exercise