code with the whole story, with only data saving part and interface to be
revised