Replaced loop with memset