some minor additions to code