Add debug code and finish major exercise for lab2