My solution for PS2