fixed deletenode function and added insertAfter function