Added dynamic printing functions. Comments. Changed formatting