Updated all files, worked correctly, added necessary comments