added functions to todo.php