programming assignment 1 implemented