working version with google api