Made changes to PDA to include stack function. Also made minor logical adjustments