stack allocation mostly works