organize and add single machine implementation