removed trailing if and updated documentation