what's this logic for? can you add a comment?