Working output, custom markup rates can be calculated, declaration bugs fixed