setting up sentinels and removing empty else statements
removing extra variables