added algorithm and types