added view thread function. adjust styles too