Recoded old architecture for new interpreter. Debug is needed.