Created code, many typos and bugs

Introduced functions to get sensed definitions, need to fix bugs and
typos before it will work