reorganized plan, setup match STDIN