From line 878 to 1084 the code is correct