patch and headers added, tests extended