answer to ex 6: modular ls