Refactored and cleaned up. It works!