fixed some bugs. added features.