added support for repitition