Added some general functions
Updated test