Fixed problem in demo and variable input arguments of functions.
Re-organize files in directories.