working version done