Implemented nearly all the leech build algorithm