pseudo code to handle circles