Tasks 3. and 6. implementation