helper function + comments everywhere
changeState + commenting