cleaned up the tools javascript a lot