Instead of using ``else`` here, you should return the array at the end of the ``if`` IMO