read part done. some bugs fixed.