CT lab4 (with bugs)