merged jakub's code into main repo