added getCode() method