a few bug fixes. still not working