added sorting, discovered deletion bugs