End-to-end working version