complete semi-pseudo implementation