got numbers reordered and clear function implemented
condensed to an array