added to_string, from_string methods and refactored alloc_frame