Changed algorithm format, finished Smolyak algorithm