fix book value stuff, error handling added