finished demo and fixed errors