added bootstrap; cleaning up functions