Optimization

changed char type to int to better use getc

Thanks to @Sebbyastian for suggestion

Closes #9