implemented malloc in C