Input Parser and ship logic