Cleaned up somewhat