add new type

Add in two kinds of method.
reconstruct former code