function inside() (also rm old function)