removed unused dictionary
renamed some variables