reverted to pure python