made changes as per comments