fixed up the boolean checks a bit