Changed tool to be more flexible