refactored and restructured - 1/11 failing