Fix for task 1, 2, 6