Cleaned codes for frame.c and frame.h <<still using hash map>>