added some todo logic and tests