logic in pickn code