seems to be working. Need to take account of different aspect ratio next