Added ABCD method calculation.
Added flatten script.