All of the coding

Will need to write document and make pretty.