Why ```tot``` could be ```None```. Isn't better to make it work also for null inputs, such that it returns a zero array?