comments and indentation cleaned up