added viewport functionality