fixed all compilation warnings and testing the compiled version