copied existing bookapp code (unstable)