added comments to revereString function and added condition in if statement. filled in findMinValue