fix a few issues: now it runs