added functions for reproducing mlsp figure