add prior next free metafunction