added structure for simpler code that should be used for A