Refactored, got b working.