changes some operators to return a reference, removed unnecesary code