Working to change this into a NODE JS module