small changes due to Marcelka's comments, some tests are still missing