splitting files, bug fixes