made boolean variables booleans, improved clarity