fixed spacing, and cleaned up logic.