tidied up the block diagram