working around total, subtotal and layout