Main code

First commit including what ive already coded at this point.