Algorithm code...a little play with it...try if its good