Some easy algorithms