Simplified the module, used simple functions.