(unstable version) Added stay-in-place mprim; fixed couple of bugs in visualization