front end changes for issues #293 (closed) and #262 (closed). Matlab code still needs to be updated before this is merged.