contract creation and viewing re-done, working properly