Refined corner list generation code