Updated to imp issue #4

This change removes many for explicit loops "in dict" searches which I hope will be marginally faster.