Added documentation & removed unused printf
fixed noreturn