fixed eof issues, everything works (albiet buggy) right now