Modified if statement and updated JavaDoc