Rough version of input module and some encoding methods.