first attempt at adding apprtc code to main.js