added set command, also refactering