The assert was just for testing. If you find it less confusing I can remove the return value & the assert .