Updated but not functional yet, problem with types