first draft of loop module done