implementation of operations

also, structural Eq and Ord for values