Student version of SM213 machine implementation.