Added initial splaying code