finalised the basic architecture ^_^