first working test
some small code improvements + some comments