updated code for two micros
added ps