Adding the realtime code