Added some new functions to version 2