Added range function