added variable return precision and more functions