working code ready for demo