fixed issue with CGR (works for 2 level models)
added a 3 level model for testing