partially working Serial code