Resolved the issue which was very trivial in the end as per the code block in slicing thro index for variable y