added getNest function