add reverse function and draw rectangle