Remove dependency on algebra package