fully working task 18, still has debug output