Code validates (almost)