reordered; cleaned up