first end-to-end working version