updated with maps example
cleaned up example code