added the final version, it works and only testing remains