converted to tk2d 2.0, some fixes