errors half done, resolve all TODO!!!