partial ruby port