Fixing Bugs

Can run this and let me know if it works on your machine? I had some
bugs that did not let me runt the code