Test 

tested on ideone, code works and results in 124