solved on paper, trying to get a nice formula