demo version of the code