make the code work with guile && add more test cases