compacted long methods and changed convert_x_position to convert_x_str