added code contracts