my solution programming assignment 2