you are running 3.1.3 right? oldboot. 5.1.2? theres no way you can flash a custom firmware with that cause your recover mode isnt pwned yet. do this first.
http://forum.gsmhosting.com/vbb/f456...-13-a-1033802/
remember this is for oldboot only iBoot-359.3.
after that. boot in recovery mode not DFU mode. then shift restore firmware with a custom 4,0 firmware. be sure to have a shsh file of your firmware in cydia 1st just in case you want to restore to previous firmwares