Kind of working, crashes some times, suspect memory leak, need to debug