compelted writing tests and better method for getting operator code