implement all the other algorihms, but watch out for XXX don't think they work how they supposed to work