added the Black algorithm, in three ways