implement wrap modes