Added some new functions. Minor bug fixes. Junk functions removed
Bug fixes