final code ready for demo