a few minor alterations to code positioning