fix soem functions
added some test