Added code for the Chain Code approach
Added code for the Chain Code approach