changed conditional in if statement from <= to <