Some algorithms done before