adjusted version and callbacks
updated version