Union of the code of lab1 and lab2