almost complete solution to #1032