working algorithm
test lifting