use typep instead of (type)-p -- cleaner, if more verbose.