Fixed typo in new getCost function
Fixed split calculation fmod vs %