Late pattern reordering

fixes #6