Here's one error: > _______________|n>1 do putChar '' > _______________________putSpc (n-1) > ________________return() this needs to line up. if that doesn't fix your problem, please try to narrow it down to just one or two function definitions and point out exactly which line is causing the error; otherwise, it's hard to debug.