cleaned up code, but still have a bug with google map API