initiall working version