nearly there, just edge case exceptions left