Add comments for main
Add find min function