Bucket elimination, buggy but nearly finished