added some crappy changes to fix previous mistakes