added some parameters and cleaned