New functions, versioning and bug fixes

Added 2 extern variables, a couple of new functions and bug fixes