Implement geometry code to detect shapes (todo)