Advanced programming assignment 3