Improved smpl

Now takes code input from terminal as well