finished (n, 1) implementaiton