Refactored code. Removed labels from output