implemented some protocol methods