New gatefinder algorithm, cleaner and less segfaulty