I need help to control 2 dc motors with a ps2 analog joystick

I alredy get the l293d and test the code, it really works.I needed to make some adjustments for the center of the joystick to be 0,but now it works perfectly.The middle of my joystick is 502,i tested with the analogread example in arduino IDE.now i need the code for two motors,i tried to double the code but it not works,what do I do now?
I can post a video.