working version updated