adding types/optimizations