Serial class modified for linux use