updated eastOf and westOf
made eastOf function more efficient