started Ternary datastructure and modified library structure