updated eastOf function and added toArray function.