Starting translating c# -> js