implemented in c sharp