Added all essential code.