not doing recurrence, not handling invalid input, but let's suppose I'm finished