Formal Specification using Z