solve without buffer