Implemented Stack-Recognition