Implemented features from second task.