updated for 3 layer analysis v. 0.1.6