task 1: code rewritten using StringBuilder instead of my realisation of list