review code, fix some typing stuff