initial import and some patches