better const
save
add test case for getfrontier