before refatoring
new resolve impl
finished new algorithm
finished new algorithm