Mod: move function to Add.hs and refactor them