implemented different modes for testing