Implemented tasks 1 & 2.