A method for reference
That's ok!
Do it first, then finish it
As long as it is not a file for a file, we are a method and a method for reference. This is very good. Isn't your api also a method for reference?
You have a good way to learn from this level
That is, you can abstract this algorithm to solve this thing alone.