cleaned up the definition of inside