beginning implementation for powers tree