renamed stack to meaningful name. various enhancements.