make sample demo and functions are fixed