RF: added classes at top of file and made cython function as hidden