Added function "Remove", fixed some bugs