intial working version