update code to understanding of command purposes