First pass solution worked