secondlargest algo added