version where everything compiles properly, and stack is built using a c function