Re-added erroneously deleted code and fixed indentation