the standard algorithm realizztion