removed unnecessary tracking, tweaked code