All needed functionality is added. Not tested.