Add Q2 answer

Please review, thanks!
Also, I tried to fully conform to the style guide, please let me know if there's anything I'm missing.
Each function should receive a list pointer instead of using the global one so that it's more generic.