manage the code of lab2