improved first half of lab 1