I reorganized things and renamed few files to make thing easier to understand and added some comments.