r: removed window from parameters and improve the equality operators