     id>> "id" associate "$pastebin/paste" swap link>string ;
 
 M: annotation entity-link
-    [ id>> "id" associate "$pastebin/paste" swap link>string ]
-    [ aid>> number>string "#" prepend ] bi
+    [ parent>> "parent" associate "$pastebin/paste" swap link>string ]
+    [ id>> number>string "#" prepend ] bi
     append ;
 
 : pastebin-template ( name -- template )


: <new-annotation-action> ( -- action )
    <page-action>
        [ validate-paste ] >>validate

        [ "id" param "$pastebin/paste" <id-redirect> ] >>display

        [
            f f <annotation>
            {
                [ deposit-paste-slots ]
                [ { "id" } deposit-slots ]
                [ insert-tuple ]
                [
                    ! Add anchor here
                    id>> "$pastebin/paste" <id-redirect>
                ]
            } cleave
        ] >>submit ;

: <delete-annotation-action> ( -- action )
    <action>
        [ { { "aid" [ v-number ] } } validate-params ] >>validate

        [
            f "aid" value <annotation> select-tuple
            [ delete-tuples ]
            [ id>> "$pastebin/paste" <id-redirect> ]
            bi
        ] >>submit ;


    { "contents" "CONTENTS" TEXT +not-null+ }
} define-persistent

TUPLE: paste < entity annotations ;

\ paste "PASTES" { } define-persistent

: <paste> ( id -- paste )
    \ paste new
        swap >>id ;

: pastes ( -- pastes )
    f <paste> select-tuples ;

TUPLE: annotation < entity parent ;

annotation "ANNOTATIONS"
{
    { "parent" "PARENT" INTEGER +not-null+ }
} define-persistent

: <annotation> ( parent id -- annotation )
    annotation new
        swap >>id
        swap >>parent ;

: fetch-annotations ( paste -- paste )
    dup annotations>> [
