slight modifications for our own purpose