Changed structures to match sma ones. Started simple lookup-merge algorithm.