updated to use inspect