added compare/3 - resolves #45