working version base cases plus one optional