rearranged/tidied up schematic