refactor to use fractions in analyzer
add concept of cost