Added more documentation and removed spaces between if and open paren