added some comments to core definitions
working through core, fixed bugs in open_te and cleaned it up