added precision as a parameter