Added comments and renamed some variables