Code for 1.1.1 and 1.1.2