program12 finally done, same with EC