Your algorithm