Final version of code

Try it!