working on code to determine center