work towards fixing the type errors
further tries to fix this
further fixes
some fixes