Cleaned up code slightly.