Variables 1 fixed

There were quite a few errors in my first bit of code so I fixed them.
Final version of the program.