Calculate signature properly