added testing/demo environment and functional saving cheked state