making it functional - tested - working