updated :start to the last API, reordered and cleaned up some useless code