fix Serial hickup bug
Performance improvements
change all int values to unsigned