Heavily optimized bookshelf mechanic.