Improved the code for adding and moving functions.
Next: Customized dialogs