forgot to include the actual algorithm