working code for demo purpose only