Small modification avoiding adjacent parallel paths in village
Avoiding duplicate functions and trying to use Function.prototype.call instead