some additions to the code