added changes from marcin