changed some coding around