Implemented first half of lab3b