Working example now. Modified both python and Javascript code.