main flow and implementing parse