tightened up type annotations for compiler