Working serial code v.01