Added lots of code. Almost done