added melt function for mopt