my reimplementation of the barebone