tools functions