a bit faster by avoiding duplicate calcuration