replaced ldt with shared_ptr on ldt
template for permutation
colors :)