edited by pmanjunath for assignment 2