Updated to a better but still not fully working, nor completed version.