add function for computing addresses