finally commiting Marek's changes after some merge conflicts