Changed to using manhattan distances and fixed operator comparison. Updates ruleset