cleaned up code with indentation