starting to un-spaghetti expanbit256's C