Added atmosphere and code refactoring