alias raww {
if ($1 == +) {
if (!$read(file.txt,s,$2)) { write file.txt $2 | echo -s saved $2 }
}
if ($1 == -) {
if ($read(file.txt,s,$2)) {
echo -s deleted $2
write -d $+ $readn file.txt
}
}
}

this alias doesn't work as i want - it writes a number to file even if it already exists there, also it's not deleting the specified numbers...can some1 tell what am i doing wrong?