Added comments for increased clarity, made raw_input statements more robust to user error, made a few cosmetic changes.