Renamed variable asd to something better
Fixed old out of bounds bug, and improved header check