splitting started, still work in progress, some bugs left