Added Module pattern, and passes tests