Working challenge 1 with wait for active code loop