it works for numbers < 41, seg fault for the rest