fixed a few bug and added some new ones