Updated Version

This has been updated to abstract the Stack and to provide a
standardised IO.