You should probably do some null and size checking to make sure you don't run into NPEs here.