added functions to prepare for the C to Python interface