Cleaned up dysfunctional code.