More work on 3-pass version, still not happy.