Added vertical movement. Algorithm should be cleaned up.