raw algorithm done