It works! Needs a major refactoring.