finished implementing stack. might still be some errors