Added code contracts and updated readme