core code.  still needs work to satisfy imports