added purpose field to history mechanism & added inting id in history.get_choices(..)