#1: Rebased from Artur's branch