Added contracts to classes