removed boolean testing redundancies