Slightly different implementation of adding rule at the beginning.