Added two locks , so it works faster, also added more constant variables