Reverted some unwanted changes to original code