made corners funciton more readable