adding tests and improving stuffs