modified to remove errors