some minor changes... still works