Performance Tuning and add Debug option