added a couple of helper codes to the codes