Cleaned up and tested.