Added contracts and more docs