cleaning up syntax errors in serial js