fixed barebones code