improved memset snippet