Finished STACK implementation