Added range function to views