revert stack index fix
organize code format