use charAt() because IE7 doesn't do string indexes