changed structure a bit of theorem