beans source code r1