updated elif to else, added docstring comment