Working version w/stdin, need to refine a couple things.