Reverting code to working version