added arrival/departure frontend logic