A bit refactored, still doesn't work but we have much more info now.