Some re-factoring , but an error still there.