Advanced programming assignment 2