fixed a bunch of minor bugs. don't know if i committed since added all the features