Fixed bugs. still working on more.