fixed bugs and smoothed out kinks. should be done