An alternative implementation of feature 3253. This is to solve Issue #34.