changed a few else if to if