from lab; completed code