Edited function. Working build
Demo to Hao Zheng