formatting for compatibility with R