Refactored and finalized, final commit