Added changes given by @jamill