fixed small bugs. should compile now