Help needed on code for line follower with obstacle avoider with Ir remote with

Hi
I'm making a smart robot car that can follow line, avoid obstacle, ir remote controlled, bluetooth controlled...

Im not having trouble with the code but the problem is that while following line the robot moves left back or right back to come to the proper position.

I dont know what to do to make it move left front or front right. Please help me as im a beginner. I have attached the code with the post.

Please help me with the changes i will have to make to the code.....

Sorry for the bad english....

I have also attached a video to the post which shows the way the robot is behaving....

Thanks in advance.

This is the link to the video

(MEGA)

Sorry you will have to download the video as I was not able to attach to the post

four_in_one_demo_mod.ino (12.4 KB)

Please do go and [ur=How to use this forum - please read. - Project Guidance - Arduino Forum]read the sticky[/url], and follow the instructions given, especially on the information needed and how to post code.