(wip) fixes to work on cpu