improved arduino parallel port code