Added main logic for Lab 4 part 1