initial import from penguin code