first step to http://ideone.com/3KtiAE