Adding logic
Updated