added code for first part of lab2