added 2d toolkit and other bug fixes