Unnecessary if statements removed
Documentation updated