implement map() in c in test