Made some minor changes. Code is 99 percent done