added entrance and exit