finished source code of first task