Changed pipes locations, added writing result to pipe