made the code work under gcc