Lab 2/3 code