implemented in c-sharp as well