My entry for SMAsh contest - #406