finish programming assignment 2, 3, 4