intial working code