Merged daniel's part - working.