added Protocols and made some fixes