added boolean and changed removeUnit