Added else if instead of separate else block for consistency/efficiency.