solutions for first 2 programming tasks