Working current_pos code with debug tools removed