Added all functions! To be tested.