add stuff from clucy that doesn't need refactoring