added tod gem, removed duplicate code