added c, stack and unstack methods, and example code