stash
moved to c
working double version