clean up + bug fixes