Fix warning
Add type signatures
Efficiency