added solution code