made function more readable