Changed code snippet to start from top left