Updated move line function