cleaned up code and fixed faulty parsed bytes calculation