Reverting all previous changes except bug fix