Some changes attempted. reverted to working version