added not compiling function and improved error handling
refactored and cleaned up a bit. Improved function id tracking