working version of the tool