Issue #9 partially done. Some sc-memory bugs realized