added boolean toggling function