assignment 6 works fine