using local memory and barriers
using atomic inc on global mem
cleaned