First pass at the complete solution