Translated all functionality, without checking for correctness yet