fixed functionality to better cover the task requrements