saving cuboids works
added algorithm saving