finished new implementation\