Updated Source

Fixed some bugs added some new features.