Resolve programming assignment 2