Added up/down code