Adding second part of second homework. There might be some problems