Reviewed code

renamed some parameters/fields/methods
fixed some compilation problems