Testing new twpath funcs, fixing bugs, clean up of code.