Added qlog and qexp along with necessary functions