reorganisation, added missing functions