some typos corrected and more code added
implemented transactions log