We could probably get away with moving this to the end of the function, so that the statusbar doesn't need to be updated multiple times in a split-second per call.