Refactored and working...