overall strucutre and code