Revert "some files deleted"

This reverts commit 5ec0f53629e6caf247d3c4d9385f92838258e3af.
mostly finished except test cases