modified stack data structure