added logic for the programming prompts. clarified a couple of comments.