made requested fixes. still need to test.