Lab 2 code