updated var names and meaning and added behavior