added single end mode (under construction)