finished comments and structuring the code