fun algorithms