fixing a couple mistakes and doing some minor cleanup