first version. without right output