bean logic