updated to working version