Implemented some new functions. Little changes in code