first commit. Known issue: memory leak on some machine