Stack calculator