Fixing code

To work with a more general price structure