Updated to allow specification of constants, updated margins to be smaller.