solved & improved code readability