work on type inference some more