sm: simplifying
sm: working. mostly
sm: working mostly the way it should