Add some comments to shell functions
Add loop function