implementing split functionality, fixed some other mechanics