added the functionality to skip zeros