Working code now needs refactored.