Make reduce snippet function. Try to fix original later.