Added multi-level implementation (only 3 levels until now)