huh.  i think there's a better way to do this.  like this one here:

http://stackoverflow.com/a/13197763/564872