Added error msgs and age_range function