margin calculations in clickcat