Fixed a few mistakes. Now works flawlessly