Added code for both tools